import request from '@/utils/request'

// 获取用户通知列表（分页/懒加载）
export function fetchNotifications(params) {
  return request({
    url: '/notification/user',
    method: 'get',
    params
  })
}

// 标记单条通知为已读
export function markNotificationRead(params) {
  return request({
    url: '/notification/read',
    method: 'post',
    params
  })
}

// 标记全部通知为已读
export function markAllNotificationsRead(params) {
  return request({
    url: '/notification/read/all',
    method: 'post',
    params
  })
}

// 删除单个通知
export function deleteNotification(params) {
  return request({
    url: '/notification/delete',
    method: 'delete',
    params
  })
}

// 删除全部通知
export function deleteAllNotifications(params) {
  return request({
    url: '/notification/delete/all',
    method: 'delete',
    params
  })
}

// 获取用户未读通知数量
export function getUnreadCount(userId) {
  return request({
    url: '/notification/unread',
    method: 'get',
    params: {
      userId
    }
  })
}

// 获取单个通知详情
export function getNotificationDetail(params) {
  return request({
    url: '/notification/detail',
    method: 'get',
    params
  })
}

// 获取用户全部通知数量
export function getTotalNotificationCount(params) {
  return request({
    url: '/notification/count',
    method: 'get',
    params
  })
}

// 获取指定用户通知ID之后的所有消息
export function getNotificationsAfterId(params) {
  return request({
    url: '/notification/after',
    method: 'get',
    params
  })
} 